#ifndef LMB_LEFT_PAD_HPP
#define LMB_LEFT_PAD_HPP

#include <string>
#include <iterator>
/**
 * @file
 */

namespace left_pad {

/**
 * @brief Returns a string, padded from the left.
 * @param s A string of type @c std::basic_string .
 * @param p Number of characters to pad to.
 */
template<typename Ch>
std::basic_string<Ch> left_pad (std::basic_string<Ch> s, size_t p) {
	size_t len= s.length();
	if (len <p) {
		s= std::basic_string<Ch>(p-len, ' ') + s;
	}
	return s;
}


} // left_pad

#endif
